﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Popup_People1.aspx.cs" Inherits="Popup_People1" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>제목 없음</title>
    <link href="../CustomCss.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/examples.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .my-grid .x-grid3-scroller
        {
            overflow: scroll;
        }
    </style>
<ext:XScript ID="XScript1" runat="server">
    <script type="text/javascript">

        var CreateRow = function() {
            parent.SelectAddPeople(document.getElementById("hdRowValue").value);

            parent.Ext.getCmp('Window1').hide();
        }
        
        var Reload = function(){
            #{GridPanel1}.getStore().reload();
        }


       
       
    </script>
</ext:XScript>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Store ID="StrCbx" runat="server">
        <Reader>
            <ext:JsonReader IDProperty="CODE">
                <Fields>
                    <ext:RecordField Name="CODE" />
                    <ext:RecordField Name="LCODENM" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    <ext:Panel ID="Panel1" runat="server" Title="" AnchorVertical="20%" Width="700">
        <Content>
            <table style="width:100%;">
                <tr>
                    <td>
                        이름
                    </td>
                    <td>
                        <ext:TextField ID="tbxName" runat="server" />
                    </td>
                    <td>
                        팀명
                    </td>
                    <td>
                        <ext:ComboBox ID="cbxTeam" runat="server" StoreID="StrCbx" DisplayField="LCODENM"
                            ValueField="CODE" />
                    </td>
                    <td>
                        <ext:Button ID="btnSearch" runat="server" Text="조회" Icon="Zoom">
                            <DirectEvents>
                                <Click OnEvent="PopListSearch">
                                    <EventMask ShowMask="true" Msg="조회중입니다..." MinDelay="30" />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </td>
                    <td>
                        <ext:Button ID="btnAdd" runat="server" Text="등록" Icon="Add">
                            <Listeners>
                                <Click Fn="CreateRow" />
                            </Listeners>
                        </ext:Button>
                    </td>
                    <td>
                        <ext:Button ID="btnPeopleI" runat="server" Text="인원등록" Icon="Add">
                            <DirectEvents>
                                <Click OnEvent="btnInser_Click">
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </td>
                    <td>
                        <ext:Button ID="btnPeopleU" runat="server" Text="선택수정" Icon="Add">
                            <DirectEvents>
                                <Click OnEvent="btnInser_Click">
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </td>
                    <td>
                        <ext:Button ID="btnPeopleD" runat="server" Text="선택삭제" Icon="Delete">
                            <DirectEvents>
                                <Click OnEvent="btnDelete_Click">
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </td>
                </tr>
            </table>
        </Content>
    </ext:Panel>
    <p>
    </p>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoScroll="true" Height="280" HideBorders="true"  HideHeaders="false" >
        <Store>
            <ext:Store ID="Store1" runat="server" OnRefreshData="AddRecords" WarningOnDirty="false">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="ID" />
                            <ext:RecordField Name="NAME" />
                            <ext:RecordField Name="JUMIN_NO" />
                            <ext:RecordField Name="CLASS" />
                            <ext:RecordField Name="ADDRESS" />
                            <ext:RecordField Name="TEL" />
                            <ext:RecordField Name="HP" />
                            <ext:RecordField Name="BANK" />
                            <ext:RecordField Name="ACCOUNT_NO" />
                            <ext:RecordField Name="PAY" />
                            <ext:RecordField Name="EMP_PER" />
                            <ext:RecordField Name="HEL_AMT" />
                            <ext:RecordField Name="NAT_AMT" />
                            <ext:RecordField Name="IN_DATE" />
                            <ext:RecordField Name="OUT_DATE" />
                            <ext:RecordField Name="GROUP_CD" />
                            <ext:RecordField Name="GROUP_NM" />
                            <ext:RecordField Name="GUBUN" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <Listeners>
                    <LoadException Handler="var e = e || {메시지: response.responseText}; alert('로드하지 못했습니다.: ' + e.message);" />
                </Listeners>
            </ext:Store>
        </Store>
        <View>
            <ext:GridView ID="GridView1" runat="server" />
        </View>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:RowNumbererColumn />
                <ext:Column ColumnID="ID" Header="코드" Width="60" DataIndex="ID" />
                <ext:Column ColumnID="NAME" Header="이름" Width="100" DataIndex="NAME" />
                <ext:Column ColumnID="JUMIN_NO" Header="주민번호" Width="150" DataIndex="JUMIN_NO" />
                <ext:Column ColumnID="GROUP_CD" Header="팀1" Width="250" DataIndex="GROUP_CD" Align="Center"
                    Hidden="true" />
                <ext:Column ColumnID="GROUP_NM" Header="팀" Width="250" DataIndex="GROUP_NM" Align="Center" />
                <ext:Column ColumnID="CLASS" Header="업무내용" Width="100" DataIndex="CLASS" Align="Center"
                    Hidden="true" />
                <ext:Column ColumnID="GUBUN" Header="업무내용" Width="100" DataIndex="GUBUN" Align="Center" />
                <ext:Column ColumnID="PAY" Header="일급" Width="100" DataIndex="PAY" Align="Right">
                    <Renderer Format="Number" FormatArgs="'0,0.0'" />
                </ext:Column>
                <ext:Column ColumnID="IN_DATE" Header="입사일" Width="120" DataIndex="IN_DATE" />
                <ext:Column ColumnID="OUT_DATE" Header="퇴직일" Width="120" DataIndex="OUT_DATE" />
                <ext:Column ColumnID="ADDRESS" Header="주소" Width="250" DataIndex="ADDRESS" />
                <ext:Column ColumnID="TEL" Header="전화번호" Width="100" DataIndex="TEL" Align="Center" />
                <ext:Column ColumnID="HP" Header="이동전화" Width="100" DataIndex="HP" Align="Center" />
                <ext:Column ColumnID="BANK" Header="은행" Width="100" DataIndex="BANK" Align="Center" />
                <ext:Column ColumnID="ACCOUNT_NO" Header="계좌번호" Width="120" DataIndex="ACCOUNT_NO"
                    Align="Center" />
            </Columns>
        </ColumnModel>
        <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:Label ID="Label1" runat="server" Text="일용직 사원 등록">
                    </ext:Label>
                    <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                </Items>
            </ext:Toolbar>
        </TopBar>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                <DirectEvents>
                    <RowSelect OnEvent="CreateParameter">
                        <ExtraParams>
                            <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))"
                                Mode="Raw" />
                        </ExtraParams>
                    </RowSelect>
                </DirectEvents>
            </ext:RowSelectionModel>
        </SelectionModel>
        <BottomBar>
            <ext:Toolbar ID="Toolbar2" runat="server">
                <Items>
                    <ext:Button ID="MoreButton" runat="server" Text="50건 더보기" Icon="Add">
                        <Listeners>
                            <Click Handler="#{Store1}.reload({add:true, params : {count: #{Store1}.getCount()} });" />
                        </Listeners>
                    </ext:Button>
                    <%--<ext:ToolbarFill ID="ToolbarFill2" runat="server" />--%>
                    <ext:Label ID="InfoLabel" runat="server" />
                </Items>
            </ext:Toolbar>
        </BottomBar>
    </ext:GridPanel>
    <ext:Hidden ID="hdRowValue" runat="server" />
    <ext:Hidden ID="Hidden1" runat="server" />
    <ext:Hidden ID="hdPrjCD" runat="server" />
    <ext:Hidden ID="hdDT" runat="server" />
    <ext:Hidden ID="hdNotIn" runat="server" />
    <ext:Hidden ID="Hidden2" runat="server"  />
    <ext:Hidden ID="Hidden3" runat="server" />
    </form>
</body>
</html>
